import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import fastclick from "fastclick";
import "babel-polyfill";
import "./assets/scss/index.scss";
// 全局引入vue-awesome-swiper
import VueAwesomeSwiper from "vue-awesome-swiper";
//全局引入vue-lazyload 懒加载
import VueLazyLoad from "vue-lazyload";
// 全局引入axios
import axios from "axios";
//  style
import "swiper/css/swiper.css";

Vue.config.productionTip = false;

// 使用vue-awsome-swiper
Vue.use(VueAwesomeSwiper /* { default options with global component } */);
// 将axios添加到vue的原型上
Vue.prototype.axios = axios;
// fastclick监听整个body
fastclick.attach(document.body);
//使用懒加载
Vue.use(VueLazyLoad, {
  preLoad: 1,
  error: require("./assets/img/error.png"),
  loading: require("./assets/img/loading.gif"),
  attempt: 1
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
